Make Ctrl+P toggle sent agent messages too - #1281
Merged
Merged
Conversation
sethkarten
self-requested a review
August 13, 2026 22:19
sethkarten
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Ctrl+Ptoggles agent-to-agent messages open and closed. Until now it only worked on messages the agent received — messages it sent stayed collapsed (they only opened together with the whole tool output viaCtrl+O). NowCtrl+Pexpands and collapses both sent and received messages together.Why
Sent and received messages are two halves of the same conversation. Having one key expand one half, and a different key (meant for tool output) expand the other, was confusing and inconsistent.
How it works
There was already a single "are agent messages expanded" switch behind
Ctrl+P. The sent-message display just wasn't connected to it — it was wired to the tool-output switch instead. The fix connects the sent-message display to the same switch the received messages use, and disconnects it from the tool-output one. So:Ctrl+Popens and closes all agent messages, sent and received.Ctrl+Ogoes back to meaning tool output only.Changes
Lines changed: source +32/−1, tests +47/−1, changelog +1/−0.
Checks
npm run checkclean.Note
Low Risk
Interactive UI rendering and expansion state only; no auth, persistence, or execution behavior changes.
Overview
Ctrl+P (
app.messages.expand) now expands and collapses sent agent messages in IPython/agent_message.sendtool rows, not only receivedAgentMessageComponentrows.Sent-message bodies in
IPythonCellComponentwere tied to tool output expansion (expanded/ Ctrl+O). They now use a separateagentMessagesExpandedflag that follows the same global toggle as received messages.ToolExecutionComponentstores that flag, passes it into nested IPython cells, andInteractiveMode.applyChatExpansionpushesagentMessagesExpandedto chat children (with a small type guard). New and rehydrated tool rows get the current setting at creation time.Ctrl+O stays for tool/code/output expansion; Ctrl+P controls all agent-to-agent message text (sent and received) together.
Reviewed by Cursor Bugbot for commit 36d6bb6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Ctrl+P to toggle sent agent messages in addition to received messages
agentMessagesExpandedflag toToolExecutionComponentandIPythonCellComponentso sent agent messages expand/collapse independently of tool output expansion.InteractiveMode.applyChatExpansionnow callssetAgentMessagesExpandedon children that support it, propagating the Ctrl+P toggle to both sent and received agent messages.agentMessagesExpandedstate at construction time via a newAgentMessagesExpandableinterface andhasAgentMessagesExpansiontype guard.Macroscope summarized 36d6bb6.